Skip to content

Instantly share code, notes, and snippets.

View lohenyumnam's full-sized avatar
👨‍💻
Working...

Lohen lohenyumnam

👨‍💻
Working...
View GitHub Profile
@lohenyumnam
lohenyumnam / _verify-repair-permissions-disk.md
Created December 8, 2017 13:14 — forked from bzerangue/_verify-repair-permissions-disk.md
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /

Disable Ubuntu Guest Session feature.

Disabling the feature If you prefer to not allow guest access to your computer, you can disable the Guest Session feature. To do so, press Ctrl+Alt+T to open a terminal window, and then run this command:

sudo sh -c 'printf "[Seat:*]\nallow-guest=false\n" >/etc/lightdm/lightdm.conf.d/50-no-guest.conf'

The command creates a small configuration file. To re-enable Guest Session, simply remove that file:

Create a Toggle Hidden Files Menu Item

  • Launch Automator
  • Select Service as the type of template to use for your new Automator task, and click the Choose button
  • In the Library pane, make sure Actions is selected, then underneath the Library item, click Utilities. This will filter the available workflow types to just those relating to utilities.
  • In the filtered list of actions, click Run Shell Script and drag it to the workflow pane.
  • At the top of the workflow pane are two drop-down menu items. Set the 'Service receives selected' to 'files or folders.' Set the 'in' to 'Finder.'
  • Copy the entire shell script command (all six lines), and use it to replace any text that may already be present in the Run Shell Script box.
@lohenyumnam
lohenyumnam / Setup Ubuntu Development Using ubuntu-make .md
Last active February 11, 2018 08:16
Setup Ubuntu Development Using ubuntu-make

Setup Ubuntu Development Using ubuntu-make

Install repo for ubuntu make

sudo add-apt-repository ppa:ubuntu-desktop/ubuntu-make
sudo apt update
sudo apt install ubuntu-make

Select the Video and Audio quality with the following command

youtube-dl -F <VideoURL>

To download the video with particular Video and Audio or Audio only just type

youtube-dl -f <AudioQuality> + <VideoQuality> <VideoURL>
Name Arch Ubuntu
Package Manager Pacman Apt-Get
Command to Refresh and Upgrade pacman -Syy apt-get update
Command to Refresh and Upgrade pacman -Syu apt-get update && apt-get dist-upgrade
Command to install wget pacman -S wget apt-get install wget
Command to install sublime-text pacaur -S sublime-text sudo add-apt-repository ppa:webupd8team/sublime-text-3 && sudo apt-get update && sudo apt-get install sublime-text-installer
@lohenyumnam
lohenyumnam / Data+PrettyPrint.swift
Created June 28, 2019 12:19 — forked from cprovatas/Data+PrettyPrint.swift
Pretty print JSON string from Data in Swift 4.1 (especially useful printing to Xcode console)
import Foundation
extension Data {
var prettyPrintedJSONString: NSString? { /// NSString gives us a nice sanitized debugDescription
guard let object = try? JSONSerialization.jsonObject(with: self, options: []),
let data = try? JSONSerialization.data(withJSONObject: object, options: [.prettyPrinted]),
let prettyPrintedString = NSString(data: data, encoding: String.Encoding.utf8.rawValue) else { return nil }
return prettyPrintedString
}
@lohenyumnam
lohenyumnam / hello_world.py
Last active January 24, 2020 06:03
Hello World Examples
class HelloWorld:
def __init__(self, name):
self.name = name.capitalize()
def sayHi(self):
print "Hello man " + self.name + "!"
hello = HelloWorld("world")
hello.sayHi()
@lohenyumnam
lohenyumnam / How to use CoreLocation in iOS using Swift 4.swift
Last active May 13, 2021 21:53
How to use CoreLocation in iOS using Swift 4 to get your location Speed, Floor, timestamp, Course Direction, Altitude above sea level
// How to use CoreLocation to get your location Speed, Floor, timestamp, Course Direction, Altitude above sea level
//TODO: Step 1 ####################################################################
// First of all import "CoreLocation"
import CoreLocation
//TODO: Step 2 ####################################################################

Install Swift on Ubuntu 17.10, Sublime Text 3 Installation and setup for Swift

Step 1

Install ubuntu make

sudo add-apt-repository ppa:ubuntu-desktop/ubuntu-make
sudo apt update