Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Luis BlaShadow

🏠
Working from home
Block or report user

Report or block BlaShadow

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@BlaShadow
BlaShadow / introrx.md
Created Sep 5, 2016 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
View introrx.md
View Chill the lion.markdown

Chill the lion

WebGL experiment using ThreeJS. Move the fan and press to make wind, the lion will surely appreciate.

A Pen by Karim Maaloul on CodePen.

License.

@BlaShadow
BlaShadow / java.java
Created Jun 13, 2014
Scroll list view into scrollview
View java.java
ListView lv = (ListView)findViewById(R.id.myListView); // your listview inside scrollview
lv.setOnTouchListener(new ListView.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
int action = event.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN:
// Disallow ScrollView to intercept touch events.
v.getParent().requestDisallowInterceptTouchEvent(true);
break;
View url_encode
// file "NSDictionary+UrlEncoding.m"
#import "NSDictionary+UrlEncoding.h"
// helper function: get the string form of any object
static NSString *toString(id object) {
return [NSString stringWithFormat: @"%@", object];
}
// helper function: get the url encoded string form of any object
static NSString *urlEncode(id object) {
View sample-test-2.js
describe('/blog', function() {
it('returns blog posts as JSON', function(done) {
api.get('/blog')
.set('x-api-key', '123myapikey')
.auth('correct', 'credentials')
.expect(200)
.expect('Content-Type', /json/)
.end(function(err, res) {
if (err) return done(err);
View CentOS-Install-gitlab_ci.sh
#!/bin/sh
rpm -Uih https://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
curl -L https://get.rvm.io | bash -s stable
rvm install 2.0.0
rvm use 2.0.0@global --default
# for chinese user, if you have a wonderful speed ignore this part
# to have a faster download speed
# switch gem source to ruby.taobao.org
View test.json
{
"country": {
"iso_code": "CO",
"names": {
"pt-BR": "Colômbia",
"es": "Colombia",
"ru": "Колумбия",
"en": "Colombia",
"zh-CN": "哥伦比亚",
"fr": "Colombie",
View lol.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from twisted.application import service
from twisted.web import server, static
from twisted.web.resource import Resource
from twisted.web.wsgi import WSGIResource
from twisted.internet import reactor
from flask.views import MethodView
@BlaShadow
BlaShadow / child.js
Created Mar 28, 2014
Child Process nodejs
View child.js
var context = [];
(function(context){
setInterval(function(){
var value = context.pop()
console.log('iteraciones ' + value);
},1000);
})(context);
process.on('message',function(value){
View test.xml
< receiver android:enabled="true" android:name=".broadcast_reciber_class" >
< intent-filter android:priority="1">
< action android:name="android.intent.action.ACTION_SET_WALLPAPER" />
< /intent-filter>
< /receiver>
You can’t perform that action at this time.