Skip to content

Instantly share code, notes, and snippets.

@NeilRobbins
NeilRobbins / cloner.sh
Last active February 8, 2022 08:53
Clone all projects for a GitLab group
ORG=PUT_THE_ORG_NAME_HERE;ACCESS_TOKEN=PUT_THE_TOKEN_HERE; curl --header "PRIVATE-TOKEN: $ACCESS_TOKEN" "https://gitlab.com/api/v4/groups/$ORG/projects" | sed 's/,/\'$'\n''/g' | grep -e 'ssh_url_to_repo*' | cut -d \" -f 4 | xargs -L1 git clone

Keybase proof

I hereby claim:

  • I am neilrobbins on github.
  • I am neilrobbins (https://keybase.io/neilrobbins) on keybase.
  • I have a public key ASAKOSp_oy9wgl97yNBGB_z6JigdNoyDV7-O183TUwD_wwo

To claim this, I am signing this object:

ORG=PUT_THE_ORG_NAME_HERE;PAGE=1;ACCESS_TOKEN=PUT_THE_TOKEN_HERE; curl "https://api.github.com/orgs/$ORG/repos?page=$PAGE&per_page=100&access_token=$ACCESS_TOKEN" | grep -e 'git_url*' | cut -d \" -f 4 | xargs -l1 git clone
@NeilRobbins
NeilRobbins / static_webserver.sh
Created August 9, 2014 20:20
start a simple webserver to serve static files
twistd -n web -p 8888 --path .
Put the commands to execute in here
@NeilRobbins
NeilRobbins / alias.cs
Last active August 29, 2015 14:02
Aliasing in C#
public abstract class Alias
{
protected readonly string Value;
protected Alias(string value)
{
if (value == null) throw new ArgumentNullException("value");
if (string.Empty.Equals(value, StringComparison.InvariantCultureIgnoreCase))
throw new ArgumentException("Value must not be empty.", "value");
Value = value;
@NeilRobbins
NeilRobbins / drop_schema_cascade.sql
Created June 10, 2014 09:49
Drop a schema with all of its tables in SQL Server. Note that this won't clean up objects other than tables.
-- DROP THE CONSTRAINTS
DECLARE @database nvarchar(50);
DECLARE @schemaName nvarchar(50);
DECLARE @sql nvarchar(300);
SET @database = ''; -- set the catalog name
SET @schemaName = ''; -- set the database name
SELECT @sql = 'USE ' + @database +';';
EXEC sp_executesql @sql;
@NeilRobbins
NeilRobbins / VerticaParameterIssue2.cs
Created April 16, 2014 12:00
Demonstrates an issue with Vertica 6.1.3 where VerticaCommands with parameters cannot contain more than one statement.
public static void M(string[] args)
{
var builder = new VerticaConnectionStringBuilder
{
Host = "54.83.238.208",
Database = "Test",
User = "dbadmin",
Password = "password",
Port = 5433,
Pooling = true,
@NeilRobbins
NeilRobbins / SimpleTypeAlias.cs
Created March 28, 2014 12:06
Simple Type Aliasing in C#
public class WeekKey
{
private int value;
public static implicit operator int(WeekKey weekKey) { return weekKey.value; }
public static implicit operator WeekKey(int weekKey) { return new WeekKey { value = weekKey }; }
}
@NeilRobbins
NeilRobbins / UsefulCommands.sh
Last active August 29, 2015 13:56
Useful linux commands
#==== change text file end-of-line from DOS (Windows) to Linux ====#
find . -name "*.sh" -exec sed -i 's/\r\+$//g' '{}' \;
#==== hardware/system info ====
numactl --hardware
dmesg