Skip to content

Instantly share code, notes, and snippets.

View cAstraea's full-sized avatar

cAstraea

View GitHub Profile
@stof
stof / config.yml
Created June 28, 2012 13:48
FOSJSRoutingBundle with FOSRestBundle
fos_js_routing:
routes_to_expose:
- "^api_.*" # expose all routes with a name starting with api_
@esimonetti
esimonetti / inboundEmailsLogic.php
Last active June 2, 2016 13:36
SugarCRM - Inbound Email Case Creation - Custom Record Assignment and Case reopening - custom/modules/Emails/inboundEmailsLogic.php
<?php
// Enrico Simonetti
// 11/09/2014
// Tested on SugarCRM 6.5.17
// Create standard Inbound Email to Case functionality, using by default an empty team ($inbound_cases_team) for round robin assignment
// Then define the custom assignment rules
/*
Logic hook entries will look something like this... if entered manually
@jalbertbowden
jalbertbowden / round-icon-circular-menu.css
Last active November 9, 2017 06:47
Position round icons into circle menu (StackOverflow) via thebabydino http://dabblet.com/gist/3864650
/**
* Position icons into circle (SO)
* http://stackoverflow.com/q/12813573/1397351
*/
.circle-container {
position: relative;
width: 24em;
height: 24em;
padding: 2.8em; /*= 2em * 1.4 (2em = half the width of an img, 1.4 = sqrt(2))*/
border: dashed 1px;
@PedroGutierrezStratio
PedroGutierrezStratio / index.html
Last active August 16, 2020 03:34
Drawing the MongoDB's data with Chart.js through WebSockets.
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<div style="margin: 20px;display: block;">
<canvas style="width: 600px; height: 300px" id="chart"></canvas>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.js"></script>
<script>
var ws = new WebSocket('ws://127.0.0.1:8008/');
@peshoicov
peshoicov / canvas.signature.js
Created October 9, 2017 10:55
Canvas signature, both desktop and mobile
// Setup canvas ..
var canvas = document.getElementById('main-canvas'),
ctx = canvas.getContext('2d');
// setup lines styles ..
ctx.strokeStyle = "#DDD";
ctx.lineWidth = 2;
// some variables we'll need ..
var drawing = false;
@ngugijames
ngugijames / longPolling.js
Created October 28, 2015 07:22 — forked from jasdeepkhalsa/longPolling.js
Simple Long Polling Example with JavaScript and jQuery by Tian Davis (@tiandavis) from Techoctave.com (http://techoctave.com/c7/posts/60-simple-long-polling-example-with-javascript-and-jquery)
// Long Polling (Recommened Technique - Creates An Open Connection To Server ∴ Fast)
(function poll(){
$.ajax({ url: "server", success: function(data){
//Update your dashboard gauge
salesGauge.setValue(data.value);
}, dataType: "json", complete: poll, timeout: 30000 });
})();
<?php
namespace App\Traits;
use App\Entities\User;
use DateTime;
use GuzzleHttp\Psr7\Response;
use Illuminate\Events\Dispatcher;
use Laravel\Passport\Bridge\AccessToken;
use Laravel\Passport\Bridge\AccessTokenRepository;
@machikoyasuda
machikoyasuda / vocabulary.md
Created September 20, 2016 17:13
Japanese/English programming/tech vocabulary

----- Tech -----

拡張現実【かくちょうげんじつ】 augmented reality, AR

投資家【とうしか】 investor

静的【せいてき】 static

@jpalala
jpalala / how-to-setup-mac-elasticsearch.md
Created September 11, 2015 08:28
setting up elasticsearch on your mac with brew

Install va homebrew

If you don't have homebrew installed - get homebrew here

Then run: brew install elasticsearch

Configuration

Update the elasticsearch configuration file in /usr/local/etc/elasticsearch/elasticsearch.yml.

@aksonov
aksonov / rnrf.md
Last active July 30, 2022 22:39
Proposal for lightning talk at ReactiveConf 2017: What is RNRF (react-native-router-flux)?

What is RNRF (react-native-router-flux)?

React Native is great product but lacks for stable, intuitive and easy navigation API during many years. Every year we see new, better API: Native Navigator, ex-Navigator, NavigationExperimental, ex-Navigation, wix native navigation, airbnb native navigation, ReactNavigation...

Once I've started React Native development, in 2015, I created RNRF - simple API for easy navigation. It was clear that better navigation instruments will come later but I didn't want to change my code again and again to switch for better API. Every new major version of RNRF is based on different navigation framework and mostly preserves own API.

Another goal was to represent all navigation flow within one place in clear, human-readable way - similar to iOS Storyboards concept. This way other engineers could understand your app flow faster.