This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cleanString (string) { | |
var find = ['.','"',"'",' ','’',';',',',':','à','á','â','ã','ä','ç','è','é','ê','ë','ì','í','î','ï','ñ','ò','ó','ô','õ','ö','ù','ú','û','ü','ý','ÿ','À','Á','Â','Ã','Ä','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ñ','Ò','Ó','Ô','Õ','Ö','Ù','Ú','Û','Ü','Ý']; | |
var replace = ['','','','-','','','','','a','a','a','a','a','c','e','e','e','e','i','i','i','i','n','o','o','o','o','o','u','u','u','u','y','y','A','A','A','A','A','C','E','E','E','E','I','I','I','I','N','O','O','O','O','O','U','U','U','U','Y']; | |
var replaceString = string; | |
var regex; | |
for (var i = 0; i < find.length; i++) { | |
regex = new RegExp(find[i], "g"); | |
replaceString = replaceString.replace(regex, replace[i]); | |
} | |
replaceString = replaceString.toLowerCase(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.directive('resizeImg', function() { | |
return { | |
restrict: 'A', | |
link: function(scope, element, attrs) { | |
var src = attrs.ngSrc; | |
var maxWidth = attrs.width; | |
var maxHeight = attrs.height; | |
var newWidth; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**********************************************/ | |
/* | |
/* SO-Dark-Monokai | |
/* https://github.com/simonowendesign/SO-Dark-Monokai | |
/* Taken from the below and tweaked by Simon Owen (@simonowendesign) | |
/* | |
/* IR_Dark_Monokai | |
/* Designed and developed by Andres Pagella (@mapagella) | |
/* http://www.andrespagella.com/customising-chrome-devtools | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[console.log(${1});]]></content> | |
<tabTrigger>log</tabTrigger> | |
<scope>source.js</scope> | |
<description>Génère un console.log()</description> | |
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
créer un fichier .vimrc dans le dossier du user, y insérer: | |
:syntax on | |
pour que ça fonctionne avec sudo, il faut ajouter ce meme fichier à la racine pour le user root | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.extract = function(prefix, suffix) { | |
s = this; | |
var i = s.indexOf(prefix); | |
if (i >= 0) { | |
s = s.substring(i + prefix.length); | |
} | |
else { | |
return ''; | |
} | |
if (suffix) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// image | |
UIImageView *iconView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 30, 50)]; | |
iconView.image = [UIImage imageNamed:@"my-icon-image"]; | |
// text | |
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 35, 50)]; | |
label.text = @"test"; | |
[iconView addSubview:label]; | |
// grab it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add font to project. In the right side, in "Target Membership", check your project. | |
* In infos.plist, add "Fonts provided by application" (array), and each item is the font file's name | |
*/ | |
NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]]; | |
NSArray *fontNames; | |
NSInteger indFamily, indFont; | |
for (indFamily=0; indFamily<[familyNames count]; ++indFamily) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(function ($) { | |
jQuery('td.description').hide(); | |
jQuery('td.select_video input').each(function () { | |
$this = jQuery(this); | |
if ($this.is(':checked')) { | |
$this.parent().parent().find('td.description').show(); | |
$this.parent().parent().find('td.image_upload').hide(); | |
}else { | |
$this.parent().parent().find('td.description').hide(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get screen size after screen rotation | |
[UIApplication sharedApplication].keyWindow.rootViewController.view.bounds.size; |
OlderNewer