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
#include <NewPing.h> | |
#define trigPin 2 | |
#define echoPin 4 | |
NewPing sonar(trigPin, echoPin, 800); | |
void setup() { | |
Serial.begin(9600); | |
} |
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
#!/bin/sh | |
# Tested with : | |
# * avconv version 9.13-6:9.13-0ubuntu0.14.04.1, | |
# * SoX v14.4.1 | |
# | |
# Just run clean.sh input_file.mp4 output_file.mp4 | |
INPUT=$1 | |
OUTPUT=$2 |
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
@CompileStatic | |
public class MainActivity extends ActionBarActivity { | |
TextView textView; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
textView = findViewById(R.id.text) as TextView; |
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
Log.d("Charset", "toString() : " + CharsetToolkit.getDefaultSystemCharset().toString()); | |
Log.d("Charset", "displayName() : " + CharsetToolkit.getDefaultSystemCharset().displayName()); | |
Log.d("Charset", "name() : " + CharsetToolkit.getDefaultSystemCharset().name()); | |
Output : | |
D/Charset﹕ toString() : java.nio.charset.CharsetICU[UTF-8] | |
D/Charset﹕ displayName() : UTF-8 | |
D/Charset﹕ name() : UTF-8 |
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
// Creates a copy of the git tree into target directory to be included on the final EAR | |
// Use zipfileset(dir: "${warDest}/src", prefix: 'src') on your ant.ear task. | |
target(generateSourceCode: "Generates a src copy") { | |
depends(defineContextRoot) | |
ProcessBuilder ps=new ProcessBuilder("/usr/bin/git", "ls-tree", "--name-only", "-r", "HEAD"); | |
def dir = "${projectTargetDir}/src" | |
new File(dir).mkdirs(); |
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
class User | |
def full_name | |
"BLA" | |
end | |
alias :full_name, :real_full_name | |
def full_name | |
@cache ||= real_full_name | |
end | |
end |
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
<VirtualHost *:80> | |
<Directory "/xxx/yyy/zzz/falta-uno/current/public"> | |
Options FollowSymLinks | |
AllowOverride None | |
Order allow,deny | |
Allow from all | |
</Directory> | |
ServerAdmin mimail@midominio.com | |
DocumentRoot /xxx/yyy/zzz/falta-uno/current/public |
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
void | |
setup_language_manager_path(GtkSourceLanguageManager *lm) | |
{ | |
gchar **lang_files; | |
int i, lang_files_count; | |
char **new_langs; | |
lang_files = g_strdupv (gtk_source_language_manager_get_search_path (lm)); | |
lang_files_count = g_strv_length (lang_files); |
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
class MyModel | |
attr_accessor :item_url | |
def as_json(options={}) | |
{ | |
:url => item_url | |
}.merge(self.attributes) | |
end | |
end |
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
<?php | |
$api = new CSApi($public_key, $private_key); | |
$res = $api->check_authentication('e@mail.com', 'clave'); | |
if ($api->has_errors) { | |
echo "$api->last_error.\n"; | |
} else { | |
if ($res == 0) { |
OlderNewer