Skip to content

Instantly share code, notes, and snippets.

View Deadpikle's full-sized avatar
👋
Howdy!

Deadpikle Deadpikle

👋
Howdy!
View GitHub Profile
@lukesampson
lukesampson / runat.ps1
Last active April 29, 2024 22:07
A powershell script to replicate some of the `at` command for Windows Server 2012.
$usage = "usage: runat (time) (command)
e.g. runat 2am shutdown -r -f -c ""restart""";
function esc($s) { [regex]::escape($s) }
$t = $args[0] # time
if($args.length -gt 1) { # command
$c = $args[1..($args.length-1)] | % { if($_ -match '\s') { "`"$_`"" } else { $_ } }
@hofmannsven
hofmannsven / README.md
Last active July 16, 2024 01:30
Git CLI Cheatsheet
@ph0b
ph0b / build.gradle
Last active February 12, 2023 07:45
sample build.gradle for generating split APKs per ABI
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig{
minSdkVersion 14
targetSdkVersion 21
versionCode 101
@eonist
eonist / NSView overlapping interaction
Created December 15, 2015 07:24
The following code demonstrates how you can handle overlapping tracking areas
import Cocoa
/*
let a = TempNSView(frame:NSRect(0,0,100,100))
a.name = "a"
addSubview(a)
let b = TempNSView(frame:NSRect(50,50,100,100))
b.name = "b"
@mminer
mminer / PreferencesViewController.swift
Last active May 19, 2024 05:06
NSTabViewController for preferences window that resizes itself to fit activated tab view.
import AppKit
class PreferencesViewController: NSTabViewController {
private lazy var tabViewSizes: [NSTabViewItem: NSSize] = [:]
override func tabView(_ tabView: NSTabView, didSelect tabViewItem: NSTabViewItem?) {
super.tabView(tabView, didSelect: tabViewItem)
if let tabViewItem = tabViewItem {
@abhi9bakshi
abhi9bakshi / tincan_moodle_learninglocker_setup.md
Last active June 1, 2022 08:15
Setting Up TinCan API with Moodle LMS and Learning Locker LRS in Ubuntu 16.04

#Setting Up TinCan API with Moodle LMS and Learning Locker LRS

#Part 1: Virtual Container

Before we get our hands dirty with the entire setup, it is necessary to ensure we do not mess with the existing installation. Setting up and configuring a local server is tricky and may sometimes break your existing configuration rendering other programs which rely on it useless. So we will use LXC to create a virtual container, where we will do all good stuff. You can read the official LXC documentation here or a brief introduction about LXC here or get started right away with the commands below.

sudo apt-get install lxc lxd-client
sudo lxc-create -t download -n LMSprototype
@dstockhammer
dstockhammer / unlist-packages.ps1
Last active February 25, 2024 18:44
Unlist all versions of a NuGet package
$PackageId = "xxx"
$ApiKey = "yyy"
$json = Invoke-WebRequest -Uri "https://api.nuget.org/v3-flatcontainer/$PackageId/index.json" | ConvertFrom-Json
foreach($version in $json.versions)
{
Write-Host "Unlisting $PackageId, Ver $version"
Invoke-Expression ".\nuget.exe delete $PackageId $version $ApiKey -source https://api.nuget.org/v3/index.json -NonInteractive"
}
@nickbclifford
nickbclifford / auto-deploying.md
Last active May 15, 2023 09:02
How to automatically deploy code to a server using Travis CI

Auto-Deploying via Travis CI

Because Travis CI can automatically execute scripts after successfully (or unsuccessfully!) executing tests, it is an obvious choice for a deployment tool. In order to deploy to a Git repository on a remote server, the process generally is as follows:

  • Set up SSH keys
  • Add the server's copy of the repository as a Git remote
  • Push to the remote
  • SSH into the server and execute any installation/compilation/miscellaneous commands

Before even touching .travis.yml...

Users

@shaildyp
shaildyp / UIView+roundCorners.swift
Last active December 7, 2022 12:14
Backward compatible maskedCorners of iOS 11.
extension UIView {
func roundCorners(_ corners: CACornerMask, radius: CGFloat) {
if #available(iOS 11, *) {
self.layer.cornerRadius = radius
self.layer.maskedCorners = corners
} else {
var cornerMask = UIRectCorner()
if(corners.contains(.layerMinXMinYCorner)){
cornerMask.insert(.topLeft)
<?php
/**
* Generated by the WordPress Option Page generator
* at http://jeremyhixon.com/wp-tools/option-page/
*/
class MyExamplePlugin {
private $my_example_plugin_options;