Skip to content

Instantly share code, notes, and snippets.

View BlaShadow's full-sized avatar
🏠
Working from home

Luis BlaShadow

🏠
Working from home
View GitHub Profile
@BlaShadow
BlaShadow / Progressview.dart
Created May 22, 2021 17:04
Progress view using flutter
/// This is the stateful widget that the main application instantiates.
class MyStatefulWidget extends StatefulWidget {
const MyStatefulWidget({Key key}) : super(key: key);
@override
_MyStatefulWidgetState createState() => _MyStatefulWidgetState();
}
/// This is the private State class that goes with MyStatefulWidget.
@BlaShadow
BlaShadow / HttpCall.swift
Created May 13, 2020 13:04
Swift HTTP Call
httpCall(url: 'http://worldtimeapi.org/api/timezone/Europe/Rome') { (result) in
print(result)
}
func httpCall(url: String, completion: @escaping (_: [String: Any]) -> Void) {
let url = URL(string: url)!
let task = URLSession.shared.dataTask(with: url) {(data, response, error) in
guard let data = data else { return }
@BlaShadow
BlaShadow / introrx.md
Created September 5, 2016 21:16 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing

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 June 13, 2014 19:51
Scroll list view into scrollview
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;
@BlaShadow
BlaShadow / url_encode
Last active August 29, 2015 14:02
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) {
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);
#!/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
{
"country": {
"iso_code": "CO",
"names": {
"pt-BR": "Colômbia",
"es": "Colombia",
"ru": "Колумбия",
"en": "Colombia",
"zh-CN": "哥伦比亚",
"fr": "Colombie",
@BlaShadow
BlaShadow / lol.py
Created April 17, 2014 14:41 — forked from faruken/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