Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Tuan Nguyen Anh anhtuank7c

🎯
Focusing
Block or report user

Report or block anhtuank7c

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
View ElasticPaginatorComponent.php
<?php
namespace App\Controller\Component;
use Cake\Controller\Component\PaginatorComponent;
use Cake\Datasource\RepositoryInterface;
use Cake\Network\Exception\NotFoundException;
use Cake\ElasticSearch\Query;
class ElasticPaginatorComponent extends PaginatorComponent
@lopis
lopis / svg-convert.sh
Created Jun 5, 2015
SVG to PNG convert and resize
View svg-convert.sh
#!/bin/bash
# I made this script to convert SVG icons for an iOS app into PNG.
# The script will create icons in 3 sizes for different screen DPIs.
find . -type f -name "*.svg" | while read f
do
FILENAME="${f%.*}"
echo '---'
inkscape -W "$FILENAME.svg"
View smscode
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
View CorsFilter.php
<?php
App::uses('DispatcherFilter', 'Routing');
class CorsFilter extends DispatcherFilter {
public function beforeDispatch(CakeEvent $event) {
if ($event->data['request']->is('OPTIONS')) {
$event->stopPropagation();
$event->data['response']->header(array(
@rodionmoiseev
rodionmoiseev / gist:2484934
Created Apr 25, 2012
Setting up Play 2.0 in build.gradle
View gist:2484934
apply plugin: 'java'
apply plugin: 'scala'
// For those using Eclipse or IntelliJ IDEA
apply plugin: 'eclipse'
apply plugin: 'idea'
def findPlay20(){
def pathEnvName = ['PATH', 'Path'].find{ System.getenv()[it] != null }
for(path in System.getenv()[pathEnvName].split(File.pathSeparator)){
for(playExec in ['play.bat', 'play.sh', 'play']){
@sahrens
sahrens / React Native: Animated - Code
Last active Nov 6, 2018
Example code from ReactEurope 2015 talk - React Native: Animated
View React Native: Animated - Code
/**
* The examples provided by Facebook are for non-commercial testing and
* evaluation purposes only.
*
* Facebook reserves all rights not expressly granted.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
@megahertz
megahertz / MobxRnnProvider.js
Last active Dec 18, 2018
This is a provider which allows to use mobx-react Provider with wix/react-native-navigation.
View MobxRnnProvider.js
import { Provider } from 'mobx-react/native';
const SPECIAL_REACT_KEYS = { children: true, key: true, ref: true };
export default class MobxRnnProvider extends Provider {
props: {
store: Object
};
context: {
@JagCesar
JagCesar / Fastfile
Created Dec 29, 2016
Cookin Fastfile
View Fastfile
# Customise this file, documentation can be found here:
# https://github.com/fastlane/fastlane/tree/master/docs
# All available actions: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md
# can also be listed using the `fastlane actions` command
# Change the syntax highlighting to Ruby
# All lines starting with a # are ignored when running `fastlane`
# If you want to automatically update fastlane if a new version is available:
# update_fastlane
View bitrise.yml
---
format_version: 1.2.0
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
app:
envs:
- opts:
is_expand: false
FASTLANE_WORK_DIR: app
- opts:
is_expand: false
@msand
msand / svg-css-inliner-color-hexer-gradient-defs-grouper-number-formatter.js
Last active Feb 19, 2019
Convert Illustrator SVG export into cross-platform CSS independent mode. CSS rule and style inlining, group gradients into a definitions tag, remove elements with display set to none, make colors hex. Works with react-native-web react-native-svg and svgs to give cross-platform web and native mobile rendering of any SVG produced in Illustrator.
View svg-css-inliner-color-hexer-gradient-defs-grouper-number-formatter.js
/*
Open console.
(Import https://raw.githubusercontent.com/MikeMcl/decimal.js/master/decimal.js first if you want/need number formatting)
Then copy & paste this + enter, to run this.
Copy console output to a NewFile.js or NewFile.jsx file.
prettier --write NewFile.js
*/
/* eslint no-console: ["error", { allow: ["log"] }] */
/* global document, Decimal*/
(() => {
You can’t perform that action at this time.