Skip to content

Instantly share code, notes, and snippets.

View tonidy's full-sized avatar

toni dy tonidy

View GitHub Profile
@cironunes
cironunes / ng-modules.md
Last active May 24, 2016 07:48
A curated list of AngularJS modules and tools
@ragingprodigy
ragingprodigy / select2_angularjs.coffee
Created December 11, 2014 12:17
Select2 AngularJs directive example with custom query call to append data to the request. Note: Providing ajax settings is not needed (and not used) when query is provided. Left here as a full example.
# The "query" configuration is adapted from this gist: https://gist.github.com/techniq/4609063
.directive 'remoteSelectPlugin', ['$http', ($http) ->
{
restrict: 'A'
link: (scope, elem, attr) ->
angular.element(elem).select2({
placeholder: attr.remoteSelectPlugin
minimumInputLength: 1
query: (options) ->
@davidwhitney
davidwhitney / TypeParsingExtensions
Created January 11, 2013 17:14
A simpler way to parse strings in C# Parsing strings in C# can be verbose and horrible. The last thing you want to do when solving some real problem, is end up with a load of code extracting values from strings and marshalling them between data types. It’s silly, so lets not do it! Instead, I offer you an extension method and some tests. Do with…
public class StringParsingNeedsToBeSimpler
{
public void HereAreSomeExamples()
{
//You know what sucks?
string value = "123";
int outt;
if(!int.TryParse(value, out outt))
{
outt = 12345; // my default!
@kamiyaowl
kamiyaowl / Program.cs
Last active June 28, 2016 09:36
C# + Sprache Lambda-Expr
using Sprache;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace lambda_calc
{
abstract class Statement { }
abstract class Expr : Statement
@sayedihashimi
sayedihashimi / call-msdeploy.ps1
Last active September 14, 2016 16:18
Shows how to call msdeploy.exe from powershell
function Execute-CommandString{
[cmdletbinding()]
param(
[Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true)]
[string[]]$command,
[switch]
$ignoreExitCode
)
@dennisseah
dennisseah / gist:8dbb7a23ef9c9c264249
Last active July 12, 2017 10:12
SAPUI5: Organizational Chart with d3.js
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
<meta http-equiv='X-UA-Compatible' content='IE=edge' />
<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
<style>
.dennisseah-orgchart .node {
cursor: pointer;
}
##################################################
#
##################################################
param(
[Parameter(Mandatory = $true)][String]$subscriptionId,
[Parameter(Mandatory = $true)][String]$storageAccountName,
[Parameter(Mandatory = $true)][String]$affinityGroupName,
[Parameter(Mandatory = $true)][String]$imageName = 'MSFT__Windows-Server-2012-Datacenter-201208.01-en.us-30GB.vhd',
[Parameter(Mandatory = $true)][String]$adminPassword,
@judotens
judotens / kaskus.py
Last active August 23, 2017 14:36
Kaskus search using official API - just for fun
# PS:
# - Extract your own kaskus oauth consumer_key & consumer_secret frm native app. Ref: http://seriot.ch/abusing_twitter_api.php#3
# - No public doc found, but here i attach an api sample sniffed from mitmproxy
import urllib, urllib2
import time
import oauth.oauth as oauth
import string
import random
import sys, json
namespace.views.MyWizard = Backbone.Views.extend({
initialize: function() {
_.bindAll(this, 'render', 'wizardMethod');
}
render: function() {
this.wizardMethod();
return this;
},
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq.Expressions;
using System.Reflection;
using System.Text;
using AutoMapper;
using AutoMapper.Mappers;
namespace IronToby.Vandelay