This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# the 'defaults' command wants the plist file path, but without the .plist extension | |
NOEXT=$(echo "$1" | cut -f 1 -d '.') | |
# extract the current CFBundleVersion value | |
VERSION=$(defaults read $NOEXT CFBundleVersion) | |
# get the number of '.' characters in the version | |
DOTCOUNT=$(echo $VERSION | awk -F"." '{print NF-1}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Security.Cryptography; | |
namespace Security | |
{ | |
public class SecurityUtils | |
{ | |
public static string ComputeChecksum(string filePath) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.IO; | |
using System.Text.RegularExpressions; | |
using System.Xml.Serialization; | |
using System.Xml; | |
using System.Runtime.Serialization; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react' | |
export class UserList extends Component { | |
constructor() { | |
super(); | |
this.state = { | |
users: [], | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Azure; | |
using Microsoft.WindowsAzure.Storage; | |
using Microsoft.WindowsAzure.Storage.Table; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace AzureTableSample | |
{ | |
public class Person : TableEntity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace AzureDemo.Models | |
{ | |
public class ServerResponse | |
{ | |
public ServerResponse() | |
{ | |
Success = true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import requests | |
result = requests.get("http://www.chron.com/news/houston-texas/") | |
soup = BeautifulSoup(result.content, 'html.parser') | |
items = soup.find_all('a', 'hdn-analytics') | |
for link in [l for l in items if 'most_popular' in l.attrs['data-hdn-analytics']]: | |
print('<a href="{}">{}</a>'.format(link.attrs['href'], link.attrs['title'])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare | |
@test nvarchar(500), | |
@idx int, | |
@c nchar(1) | |
set @idx = 1 | |
set @test = 'Nå er tiden for alle gode menn til å komme til unnsetning for landet sitt.' | |
while @idx < LEN(@test) | |
begin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private string GetDataFromResults(SearchResult result, string propertyName) | |
{ | |
if (!result.Properties.Contains(propertyName) || result.Properties[propertyName].Count == 0) | |
{ | |
return null; | |
} | |
var prop = result.Properties[propertyName][0]; | |
var data = prop.GetType() == typeof (byte[]) | |
? Encoding.UTF8.GetString((byte[]) prop) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am slmcmahon on github. | |
* I am slmcmahon (https://keybase.io/slmcmahon) on keybase. | |
* I have a public key whose fingerprint is 5EDF 98DD DF62 2F0A D425 6173 93DA CB79 C1F8 E531 | |
To claim this, I am signing this object: |